﻿using System.Windows.Controls;

namespace KinonekoSoftware.Studio.Pages.Shenanigans
{

    [Associate(View = typeof(FriendTalkingGalleryView), ViewModel = typeof(FriendTalkingGalleryViewModel))]
    public partial class FriendTalkingGalleryView
    {
        public FriendTalkingGalleryView()
        {
            InitializeComponent();
        }
        
        
        protected override void OnViewModelMessaging(object parameter)
        {
            if (parameter is null)
            {
                var vm = ViewModel<TalkingGalleryViewModel>();

                OpenChannelButton.IsEnabled     = RemoveChannelButton.IsEnabled = vm.SelectedChannel is not null;
                RemoveCharacterButton.IsEnabled = vm.SelectedCharacter is not null;
            }
            
            base.OnViewModelMessaging(parameter);
        }
    }
    
}